package edu.ccut.saturn.basevalidate.prvalidate;

import edu.ccut.saturn.component.DefaultSaturnValidate;
import edu.ccut.saturn.component.ValidateResult;

public class IsAccountNameValidate extends DefaultSaturnValidate {

	private static final String accountRegExpr = "[a-zA-Z0-9][a-zA-Z0-9_-]*";

	public void doValidate(Object value, Object[] args, ValidateResult result) {
		
		if (!(value.toString()).matches(accountRegExpr)) {
			sendError(_ERROR_, value, result);
		}
	}
}
